package com.example.danangtravel.Restaurant;

import java.util.List;

import android.content.Context;
import android.graphics.Bitmap;
import android.view.View;
import android.view.ViewGroup;
import android.widget.BaseAdapter;
import android.widget.Gallery;
import android.widget.ImageView;

public class ImagesAdapterGallery extends BaseAdapter {
	Context context;
	List<Bitmap> bitmaps;
	public ImagesAdapterGallery(Context context,List<Bitmap> bitmaps) {
		this.context=context;
		this.bitmaps=bitmaps;
	}

	public int getCount() {
		// TODO Auto-generated method stub
		return bitmaps.size();
	}

	public Bitmap getItem(int positon) {
		// TODO Auto-generated method stub
		return bitmaps.get(positon);
	}

	public long getItemId(int positon) {
		// TODO Auto-generated method stub
		return positon;
	}

	public View getView(int position, View convertView, ViewGroup parent) {
		ImageView imageView=new ImageView(context);
		imageView.setImageBitmap(bitmaps.get(position));
		imageView.setScaleType(ImageView.ScaleType.FIT_XY);
		imageView.setLayoutParams(new Gallery.LayoutParams(136, 88));
		return imageView;
	}

}
